﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

namespace homework2_bank.classes
{
    class Cash
    {
        public int Money { get; set; }

        public bool Complete { get; set; }
        public int Owner { get; set; }

        public Cash(int num , int owner)//0是人放入ATM的，1是ATM吐出的
        {
            Owner = owner;
            Money = num;
            Random random = new Random();
            int randomNumber = random.Next(3);
            Complete = randomNumber == 0 ? false : true;
            if (!Complete && Owner == 1)
            {
                throw new BadCashException("这是ATM里的一张坏钞!");
            }
        }
    }
}
